<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.lang.StringBuilder"%>
<%@page import="com.aurora.app.entity.CategoryThing"%>


<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8" http-equiv="content-type" content="text/html">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>首页</title>
<style>
a:visited, a:hover, a:active {
	text-decoration: none;
}

a:link {
	text-decoration: none;
	color: #000;
}
</style>

<jsp:include page="../headres.jsp" flush="true" />
<link href="css/index_content.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="js/leijiaqi.js" type="text/javascript"></script>


<script>
	$(document).bind('mobileinit', function() {
		$.mobile.changePage.defaults.changeHash = false;
		$.mobile.hashListeningEnabled = false;
		$.mobile.pushStateEnabled = false;
	});
</script>


<!-- 轮播//////////////////////// -->
<!--<link href="css/lunbo.css" rel="stylesheet">  -->

</head>
<body>
<input type="hidden" data-page="0" id="pageName"/>
	<div data-role="page" id="user_page">
		<div data-role="content" class="content">
			
			 <!--头部搜索-->
    <div class="index-head">
        <div class="index-search">
           <input class="search-text" type="text" placeholder="搜索你想要的物品" data-role="none" />
           <a href="javascript:search(this)" class="search-btn">
             <img src="images/search.png" />
           </a>
        </div>
    </div>

			<div id="demo" class="demo">

				<div id="owl-demo" class="owl-carousel">
					<%
						List<CategoryThing> listCategoryThing = (List<CategoryThing>) request.getAttribute("listCategoryThing");
					%>

					<%
						int size = listCategoryThing.size();
						int index = 0;
						while (true) {
					%>
					<div class="b_item">
						<%
							for (int i = 0; i < 4; i++) {

									if (index > (size - 1)) {
										break;
									}
						%>
						<div class="b_item_inav">
							<%
							StringBuilder sb = new StringBuilder();
							sb.append("<a href='api/index/search.do?catagoryId="+listCategoryThing.get(index).getId()+"'>");
							sb.append("<img src='"+listCategoryThing.get(index).getUrl()+"' />");
							sb.append("<span>");
							sb.append(listCategoryThing.get(index).getName());
							sb.append("</span>");
							sb.append("</a>");
							
							out.write(sb.toString());
							index++;
							%>
						</div>
						<%
							}
						%>

					</div>

					<%
						if (index > (size - 1)) {
								break;
							}
						}
					%>
				</div>

			</div>
			<script src="js/jquery-1.9.1.min.js"></script>
			<script src="js/lunbo.js"></script>
			<script>
				$(document).ready(function() {
					$("#owl-demo").owlCarousel({
						navigation : true
					});
				});
			</script>

			<div class="column">
				<div id="tab" class="title">
					<span class="tab" data-type="0">最新</span>
					 <span data-type="1">关注度</span>
				</div>
				<div class="line"></div>
				<div id="tabcontent" class="job_plan">
					<ul class="mytab tabcontent">
						<input type="hidden" value="false" class = "isLast" data-index="1" />
					</ul>

					<ul class="mytab">
					<input type="hidden" value="false" class = "isLast" data-index="1"/>
					</ul>
				</div>
			</div>
		</div>
		<jsp:include page="../footer.jsp" flush="true" />
		<script type="text/javascript" src="js/index.js"></script>

	</div>
</body>
<script>
function search(a){
	var input = $(".index-head input").val();
	location.href= "api/index/search.do?searchKey="+input;
}
</script>
</html>



